package com.example.librarysystem.Dao;

import com.example.librarysystem.entity.Borrow;
import com.example.librarysystem.entity.BorrowInfo;
import org.springframework.stereotype.Component;

import java.sql.Date;
import java.util.List;

@Component("borrowDao")
public interface BorrowDao {
    Integer selectCount();
    Integer selectCountByBookName(String bookName);
    List<BorrowInfo> selectBorrowInfo(int borrowerId, int currentPage, int pageSize);
    List<BorrowInfo> selectBorrowInfoSearch(int borrowerId, String bookName, String author, String publishingHouse, int currentPage, int pageSize);
    List<Borrow> selectLastBorrow(String bookName);
    Borrow selectLastBorrowByBookId(Integer id);
    List<Borrow> selectByBookName(String bookName);
    List<Borrow> selectBorrowAll(int currentPage, int pageSize);
    int selectBookId(int id);
    int selectIsReturn(int id);
    int selectBorrowInfoCount(int borrowerId);
    int selectBorrowInfoSearchCount(int borrowerId, String bookName, String author, String publishingHouse);
    void insertBorrow(Borrow borrow);
    void updateEndDate(Date end, Integer id);
    void updateIsReturn(boolean isReturn, Integer id);
    Borrow selectById(int id);
    List<Borrow> selectByBorrowerId(int borrowerId);
    List<Borrow> selectBorrowerBetween(Date start, Date end);
    List<Borrow> selectBorrowerOver(Date end);
}
